package org.wangzx.framework.security.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Component;
import org.wangzx.framework.security.api.WzxUserDetailService;

/**
 * Created by WangZX on 2018/7/11.
 */
@Component
public class SimpleUserDetailsService implements UserDetailsService {

    @Autowired
    private WzxUserDetailService wzxUserDetailService;

    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        return wzxUserDetailService.loadUserByUsername(username);
    }
}
